#ifndef __MCS__FUNCTION__HPP
#define __MCS__FUNCTION__HPP

#include "Object.hpp"
#include "FunctionSignature.hpp"

class Function : public Object
{
protected:
	Function(String const & name, Value::DataType retType)
		: Object()
		, signature_(name)
		, retType_(retType)
	{}
	virtual ~Function() {}
public:
	Value::DataType returnType() const { return retType_; }
	FunctionSignature const & signature() const { return signature_; }
	virtual ptr<Value> invoke(std::vector< ptr<Value> > const & args) const = 0;
protected:
	void addArgType(Value::DataType t) { signature_.addArgumentType(t); }
private:
	FunctionSignature signature_;
	Value::DataType retType_;
};


#endif //__MCS__FUNCTION__HPP
